package world.snowcrystal.configuration;


import com.alibaba.otter.canal.client.CanalConnectors;
import com.alibaba.otter.canal.common.utils.AddressUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.alibaba.otter.canal.client.CanalConnector;
import org.springframework.context.annotation.Scope;

import java.net.InetSocketAddress;

import static org.springframework.beans.factory.config.BeanDefinition.SCOPE_PROTOTYPE;

@Configuration
public class EsConfiguration {



    @Bean
    @Scope(SCOPE_PROTOTYPE)
    public CanalConnector canalConnector() {
        return CanalConnectors
                .newSingleConnector(new InetSocketAddress(AddressUtils.getHostIp(),
                11111), "example", "", "");
    }
}
